using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "CardConfig", menuName = "山中战纪/卡牌配置")]
public class CardConfig : ScriptableObject
{
    [System.Serializable]
    public class CardData
    {
        public string id;
        public string name;
        public string description;
        public int energyCost;
        public CardType cardType;
        public Rarity rarity;
        public TargetType targetType;
    }

    public List<CardData> allCards = new List<CardData>();

    public CardData GetCardData(string cardId)
    {
        return allCards.Find(card => card.id == cardId);
    }

    public List<CardData> GetCardsByRarity(Rarity rarity)
    {
        return allCards.FindAll(card => card.rarity == rarity);
    }

    public List<CardData> GetCardsByType(CardType type)
    {
        return allCards.FindAll(card => card.cardType == type);
    }
}